import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import login from "../views/login.vue"
import mainpage from '../views/mainpage.vue'
import YBC_model from '@/views/model/YBC_model.vue'
import userpic from '@/views/picture/userpic.vue'
import model_pred from '@/views/model/model_pred.vue'
import home from '@/views/home.vue'
import svm from '@/views/model/svm.vue'



const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path:'/',
      name:'login',
      component:login
    },
    {
      path:'/mainpage',
      name:'mainpage',
      component:mainpage,
      children:[
        {
          path:'',
          name:'YBC_model',
          component:YBC_model
        },
        {
          path:'userpic',
          name:'userpic',
          component:userpic
        },
        {
          path:'model_pred',
          name:'model_pred',
          component:model_pred
        },
        {
          path:"home",
          name:'home',
          component:home
        },
        {
          path:'svm',
          name:'svm',
          component:svm
        },
      ]
    }
  ]
})

export default router
